package sketch.generator;

import sketch.util.Checker;

public class GeneratorLink implements IIterationLink {
	
	private IGenerator<?> innerGenerator;
	
	public GeneratorLink(IGenerator<?> generator) {
		Checker.checkNull(generator, "The generator for constructor could not be null.");
		this.innerGenerator = generator;
	}
	
	public IGenerator<?> getInnerGenerator() {
		return this.innerGenerator;
	}

	@Override
	public boolean hasNext() {
		return this.innerGenerator.hasNext();
	}

	//only moves the iterator, but omit the return value
	@Override
	public void next() {
		this.innerGenerator.next(); 
	}

	@Override
	public void reset() {
		this.innerGenerator.reset();
	}
}
